package com.chuyangc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chuyangc.entity.Goods;
import com.chuyangc.service.GoodsService;
import com.chuyangc.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 欧楚杨
* @description 针对表【goods】的数据库操作Service实现
* @createDate 2022-05-04 19:41:03
*/
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods>
    implements GoodsService{
    @Autowired
    GoodsMapper goodsMapper;
    @Override
    public boolean updateByGid(Goods goods) {
        int i = goodsMapper.updateGoodsnameAndStatusAndDistrictAndCountsAndPriceAndSellersIdByGid(
                goods.getGoodsname(),
                goods.getStatus(),
                goods.getDistrict(),
                goods.getCounts(),
                goods.getPrice(),
                goods.getSellersId(),
                goods.getGid()
        );
        if (i == 1){
            return true;
        }else {
            return false;
        }
    }
}




